<%@page import="ca.uvic.group2.ui.*"%>
<%@page import="ca.uvic.group2.api.*"%>


<html>
<head>
<title>StockServ Login</title>
<style>
body
{
        background-color: white;
}

.loginform
{
        border: 1px solid black;
        background-color: #ccc;
        width: 50%;
        margin-left: 25%;
        margin-right: 25%;
}
.errorMessage
{
        border: 1px solid #990;
        background-color: #FFA;
        margin: 5px;
}
</style>

<script>
function setFocus() { document.f.username.focus(); }
</script>
</head>

<body onload="setFocus();">
<h1>StockServ Login</h1>
<div class='loginform'>
<form name='f' action='stockserv'>
<center><table>
        <tr>
                <td>User name:</td>
                <td><input type='TEXT' name='username'></tr>
        </tr>
        <tr>
                <td>Password:</td>
                <td><input type='PASSWORD' name='password'></td>
        </tr>
        <tr>
                <td></td>
                <td><input type='SUBMIT' value='Login'></td>
        </tr>                   
</table></center>
<input type='hidden' name='cmd' value='login'>
</form>
<% 
   Object message = request.getAttribute("errorMessage");
   if (message != null) {
      out.print("<center><div class='errorMessage'>");
      out.print(message.toString());
      out.print("</div></center>");
   }
%>

</div>

<div class='loginform'>
<form name='commands' action='stockserv'>
<input type='hidden' name='cmd' value='none'>
  <center>
        <input type='submit' value='Dumplog' onclick='document.commands.cmd.value="dumplog";'><br>
        <input type='submit' value='Init' onclick='document.commands.cmd.value="init";'><br>
        <input type='submit' value='Reset Stats Collection' onclick='document.commands.cmd.value="statstart";'><br>
        <input type='submit' value='Stop Stats Collection' onclick='document.commands.cmd.value="statstop";'><br>
        <input type='submit' value='View Stats' onclick='document.commands.cmd.value="statget";'><br>
  </center>
</form>
</div>
</body>
</html>
